import java.io.Serializable;

import javax.swing.ImageIcon;

public class Road extends draggableLabel implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String orientation;
	private boolean isBridge;
	public Road(int X, int Y, ImageIcon icon, String orientation,boolean bridge) {
		super(X, Y, icon,null);
		this.orientation=orientation;
		this.isBridge=bridge;
	}
	public boolean isBridge() {
		return isBridge;
	}
	public void setBridge(boolean isBridge) {
		this.isBridge = isBridge;
	}
	public String getOrientation()
	{
		return this.orientation;
	}
	public boolean isPerpendicular(Pipe p)
	{
		if(this.getOrientation() == "vertical" && p.getOrientation() == "horizontal")
		{
			return true;
		}
		else if(this.getOrientation() == "horizontal" && p.getOrientation() == "vertical")
		{
			return true;
		}
		else
			return false;
	}
	public boolean isPerpendicular(Road r)
	{
		if(this.getOrientation() == "cross")
			return true;
		if(this.getOrientation() == "vertical" && r.getOrientation() == "horizontal")
		{
			return true;
		}
		else if(this.getOrientation() == "horizontal" && r.getOrientation() == "vertical")
		{
			return true;
		}
		else
			return false;
	}

	
	
}
